﻿using AgencyManagerSystem.Model;
using System.Collections.Generic;
using System.Linq;

namespace AgencyManagerSystem.DataFetcher
{
    public class PuOrderDetailFetcher : DetailFetcher<PuOrderDetailModel>
    {
        public PuOrderDetailFetcher() : base()
        {

        }
        public override IList<PuOrderDetailModel> ListDetail(int mainId)
        {
            Condition[] conditions = new Condition[] { new Condition() { Key = "OrderId", Op = "=", Value = mainId } };
            var list = List(conditions);
            return list;
        }

        public override IList<PuOrderDetailModel> ListDetail(int mainId, int pos, int size)
        {
            Condition[] conditions = new Condition[] { new Condition() { Key = "OrderId", Op = "=", Value = mainId } };
            var list = List(conditions, pos, size);
            return list;
        }

        public virtual IList<PuOrderDetailModel> ListByProduction(int production)
        {
            Condition[] conditions = new Condition[] { new Condition() { Key = "ProductionId", Op = "=", Value = production } };
            var list = List(conditions);
            return list;
        }
    }
}
